package org.domain.sigepac.Entity;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.ForceDiscriminator;

@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@Table(name="tb_destino")
@DiscriminatorColumn(name="tipo",discriminatorType=DiscriminatorType.STRING)
@DiscriminatorValue("evasao")
@ForceDiscriminator
public class Evasao extends DestinoAbstract implements Cloneable{

	private static final long serialVersionUID = 1L;
	public Evasao Clone() throws CloneNotSupportedException{
		return (Evasao) super.clone();
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_motivo", insertable = false, updatable = false)
	private MotivoEvasao motivo;


	public MotivoEvasao getMotivo() {
		return motivo;
	}
	public void setMotivo(MotivoEvasao motivo) {
		this.motivo = motivo;
	}
}
